package com.beametl.sample.flinkrunner;

import com.beametl.sample.origin.JDBCToTextSampleOrigin;

import org.apache.beam.runners.flink.FlinkPipelineOptions;
import org.apache.beam.runners.flink.FlinkRunner;
import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.options.PipelineOptionsFactory;

/*关系型数据库到文本之间的ETL传输样例*/
public class JDBCToTextSample {

    public static void main(String[] args) {
        PipelineOptions pipe = PipelineOptionsFactory.fromArgs(args).as(FlinkPipelineOptions.class);
        pipe.setRunner(FlinkRunner.class);
        Pipeline pipeline = Pipeline.create(pipe);
        JDBCToTextSampleOrigin.dealWithPipeline(pipeline);

        pipeline.run().waitUntilFinish();
    }
}
